home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / comp / bnot.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  563 b   |  24 lines

  1. /*
  2.                              B N O T . C
  3. */
  4.  
  5. #include "iccomp.h"
  6.  
  7. ESTRUC_ *bnot (ESTRUC_ *e)                   /* expression so far */
  8. {
  9.     if (test_operand(e, op_bnot))            /* test types ok */
  10.     {
  11.         semantic(illegal_type, opstring[op_bnot]);
  12.         return (e);
  13.     }
  14.  
  15.     if ((e->type & ~ALLTYPES) == e_const)   /* immediate value */
  16.         e->evalue = ~e->evalue;
  17.     else
  18.     {
  19.         etoc(e);                            /* convert to code */
  20.         gencode(e, op_bnot);                /* generate instruction */
  21.     }
  22.  
  23.     return (e);
  24. }